<template>
  <div id="app">
    <div id="nav">
      <router-link to="/">$nextTick和mixins</router-link> |
      <router-link to="/about">子路由和keepAlie等</router-link>|
       <router-link to="/cart">动态组件和指令</router-link>|
       <router-link to="/mine">$set</router-link>|
       <router-link to="/temp">vuex的分模块</router-link>|
       <router-link to="/mymap">vuex的辅助函数用法</router-link>|
        <router-link to="/eleui">elementui用法</router-link>
    </div>
    <!-- keepalive在项目中总体配置 -->
    <!-- 被缓存的组件 -->
     <!-- vue2的 路由配置项中meta如何使用 -->
    <!-- $route.meta.KeepAlive -->
    <keep-alive > 
          <router-view v-if="$route.meta.KeepAlive"  />
      <!--  -->
    </keep-alive>

    <!-- 不缓存的组件 -->
      <router-view v-if="!$route.meta.KeepAlive"  />
  </div>
</template>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
